echo off
set siteurl=<url of portal as http://uportal.xx>
set stspath="c:\program files\common files\microsoft shared\web server extensions\14\bin"

set wspCore=Uportal.Shp.Core.wsp
set wspMain=Uportal.Shp.Main.wsp
set wspUI=Uportal.Shp.UI.wsp

echo ----------------------------
echo -    REINSTALL LIBRARY   -
echo ----------------------------
gacutil.exe /u And.Sharepoint.Common
gacutil.exe /i And.Sharepoint.Common.dll

echo ----------------------------
echo -    UNINSTALL Uportal.Shp.Core    -
echo ----------------------------
rem echo -            retractsolution
rem echo - %stspath%\stsadm -o retractsolution -name %wspCore% -local  -url %siteurl%
echo -             deletesolution
%stspath%\stsadm -o deletesolution -name %wspCore% -override

echo ----------------------------
echo -    UNINSTALL Uportal.Shp.Main    -
echo ----------------------------
echo -          deactivatefeature
%stspath%\stsadm -o deactivatefeature -name "Uportal.Shp.Main_Uportal.Shp.Main" -url %siteurl%
echo -            retractsolution
%stspath%\stsadm -o retractsolution -name %wspMain% -local  
echo -             deletesolution
%stspath%\stsadm -o deletesolution -name %wspMain% -override

echo ----------------------------
echo -    UNINSTALL Uportal.Shp.UI    -
echo ----------------------------
echo -          deactivatefeature tj
%stspath%\stsadm -o deactivatefeature -name "Uportal.Shp.UI_FeatureTJ" -url %siteurl% 
echo -          deactivatefeature ui
%stspath%\stsadm -o deactivatefeature -name "Uportal.Shp.UI_FeatureUI" -url %siteurl% 
echo -            retractsolution
%stspath%\stsadm -o retractsolution -name %wspUI% -local  
echo -             deletesolution
%stspath%\stsadm -o deletesolution -name %wspUI% -override

echo ----------------------------
echo -     INSTALL Uportal.Shp.Core     -
echo ----------------------------
echo -                addsolution
%stspath%\stsadm -o addsolution -filename %wspCore%
rem echo -             deploysolution
rem %stspath%\stsadm -o deploysolution -name %wspCore% -local -allowgacdeployment -force -url %siteurl% 

echo ----------------------------
echo -     INSTALL Uportal.Shp.Main     -
echo ----------------------------
echo -                addsolution
%stspath%\stsadm -o addsolution -filename %wspMain%
echo -             deploysolution
%stspath%\stsadm -o deploysolution -name %wspMain% -local -allowgacdeployment -force 
echo -            activatefeature
%stspath%\stsadm -o activatefeature -name "Uportal.Shp.Main_Uportal.Shp.Main" -url %siteurl% -force

echo ----------------------------
echo -     INSTALL Uportal.Shp.UI     -
echo ----------------------------
echo -                addsolution
%stspath%\stsadm -o addsolution -filename %wspUI%
echo -             deploysolution
%stspath%\stsadm -o deploysolution -name %wspUI% -local -allowgacdeployment -force 
echo -            activatefeature tj
%stspath%\stsadm -o activatefeature -name "Uportal.Shp.UI_FeatureTJ" -url %siteurl% -force
echo -            activatefeature ui
%stspath%\stsadm -o activatefeature -name "Uportal.Shp.UI_FeatureUI" -url %siteurl% -force
pause
